<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>虚拟偶像互动小游戏 - 治愈系原型</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #fef7f0 0%, #f8f9ff 100%);
            min-height: 100vh;
            overflow-x: hidden;
            user-select: none;
        }

        /* 主容器 */
        .game-container {
            max-width: 375px;
            margin: 0 auto;
            min-height: 100vh;
            position: relative;
            background: linear-gradient(180deg, #fff9f5 0%, #f8f9ff 100%);
            box-shadow: 0 0 30px rgba(139, 69, 19, 0.1);
        }

        /* 头部区域 */
        .header {
            background: linear-gradient(135deg, #ffb3d1 0%, #c8a8e9 100%);
            padding: 20px 15px 15px;
            border-radius: 0 0 25px 25px;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0%, 100% { transform: rotate(0deg); }
            50% { transform: rotate(180deg); }
        }

        .user-info {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 15px;
            position: relative;
            z-index: 2;
        }

        .avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: linear-gradient(45deg, #ff9a9e, #fecfef);
            border: 3px solid rgba(255,255,255,0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
        }

        .user-details h3 {
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .bean-count {
            background: rgba(255,255,255,0.2);
            padding: 4px 12px;
            border-radius: 20px;
            color: #fff;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        /* 主界面：虚拟偶像展示区 */
        .main-character-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            text-align: center;
            position: relative;
        }

        .character-showcase {
            margin-bottom: 30px;
        }

        .character-avatar-large {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ffb3d1, #c8a8e9);
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 100px;
            border: 6px solid rgba(255,255,255,0.9);
            box-shadow: 0 15px 40px rgba(255, 179, 209, 0.4);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .character-avatar-large:hover {
            transform: scale(1.05);
            box-shadow: 0 20px 50px rgba(255, 179, 209, 0.6);
        }

        .character-avatar-large::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -3px;
            right: -3px;
            bottom: -3px;
            background: linear-gradient(45deg, #ffb3d1, #c8a8e9, #a8e6cf, #ffb3d1);
            border-radius: 50%;
            z-index: -1;
            animation: rotate 4s linear infinite;
        }

        @keyframes rotate {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .character-name-large {
            font-size: 24px;
            font-weight: 700;
            color: #5a5a5a;
            margin-bottom: 12px;
            text-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .character-desc-large {
            font-size: 16px;
            color: #888;
            line-height: 1.5;
            margin-bottom: 20px;
        }

        /* 快速互动提示 */
        .quick-interaction-hint {
            background: rgba(168, 230, 207, 0.2);
            color: #2e7d32;
            padding: 12px 20px;
            border-radius: 20px;
            font-size: 14px;
            margin-bottom: 25px;
            border: 1px solid rgba(168, 230, 207, 0.3);
        }

        /* 简化版进度条 */
        .simple-progress {
            width: 100%;
            max-width: 300px;
            margin: 0 auto;
        }

        .progress-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .level-text {
            font-weight: 600;
            color: #5a5a5a;
        }

        .progress-value {
            color: #888;
        }

        .progress-bar-simple {
            background: #f0f0f0;
            height: 8px;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .progress-fill-simple {
            background: linear-gradient(90deg, #ffb3d1, #c8a8e9);
            height: 100%;
            border-radius: 10px;
            width: 70%;
            transition: width 0.5s ease;
        }

        /* 功能入口图标区域 */
        .function-entries {
            display: flex;
            justify-content: space-around;
            padding: 15px 20px;
            background: rgba(255,255,255,0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid rgba(255, 179, 209, 0.2);
            position: relative;
            z-index: 10;
        }

        .entry-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 12px 8px;
            border-radius: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            min-width: 70px;
        }

        .entry-btn:hover {
            background: rgba(255, 179, 209, 0.1);
            transform: translateY(-2px);
        }

        .entry-icon {
            font-size: 24px;
            margin-bottom: 4px;
        }

        .entry-label {
            font-size: 12px;
            font-weight: 500;
            color: #5a5a5a;
        }

        .entry-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
            color: white;
            font-size: 10px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 10px;
            min-width: 16px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
        }

        /* 二级界面样式 */
        .secondary-interface {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, #fef7f0 0%, #f8f9ff 100%);
            z-index: 1000;
            transform: translateY(100%);
            transition: transform 0.3s ease;
            overflow-y: auto;
        }

        .secondary-interface.show {
            transform: translateY(0);
        }

        .interface-header {
            display: flex;
            align-items: center;
            padding: 20px 15px 15px;
            background: linear-gradient(135deg, #ffb3d1 0%, #c8a8e9 100%);
            color: white;
            position: sticky;
            top: 0;
            z-index: 1001;
        }

        .back-btn {
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .back-btn:hover {
            background: rgba(255,255,255,0.2);
        }

        .interface-title {
            flex: 1;
            text-align: center;
            font-size: 18px;
            font-weight: 600;
            margin-right: 60px;
        }

        .interface-content {
            padding: 20px 15px;
        }

        /* 个人界面特殊样式 */
        .profile-section {
            text-align: center;
            margin-bottom: 30px;
            padding: 20px;
            background: rgba(255,255,255,0.9);
            border-radius: 20px;
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
        }

        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ffb3d1, #c8a8e9);
            margin: 0 auto 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            border: 3px solid rgba(255,255,255,0.8);
            box-shadow: 0 8px 25px rgba(255, 179, 209, 0.4);
        }

        .profile-name {
            font-size: 20px;
            font-weight: 600;
            color: #5a5a5a;
            margin-bottom: 8px;
        }

        .profile-beans {
            font-size: 16px;
            color: #e91e63;
            font-weight: 600;
        }

        .emotional-progress-detail {
            background: rgba(255,255,255,0.9);
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
        }

        .healing-tip {
            background: linear-gradient(135deg, #a8e6cf, #dcedc8);
            color: #2e7d32;
            padding: 8px 15px;
            border-radius: 15px;
            font-size: 13px;
            margin-top: 10px;
            display: inline-block;
        }

        /* 治愈道具区域 */
        .healing-tools {
            margin: 15px;
            background: rgba(255,255,255,0.9);
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
        }

        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: #5a5a5a;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .tools-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .tool-item {
            background: linear-gradient(135deg, #fff, #f8f9ff);
            border: 2px solid transparent;
            border-radius: 15px;
            padding: 15px 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .tool-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, #ffb3d1, #c8a8e9);
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 0;
        }

        .tool-item:hover::before {
            opacity: 0.1;
        }

        .tool-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
            border-color: #ffb3d1;
        }

        .tool-item.free {
            border-color: #a8e6cf;
        }

        .tool-item.paid {
            border-color: #ffb3d1;
        }

        .tool-icon {
            font-size: 24px;
            margin-bottom: 8px;
            position: relative;
            z-index: 1;
        }

        .tool-name {
            font-size: 13px;
            font-weight: 500;
            color: #5a5a5a;
            margin-bottom: 4px;
            position: relative;
            z-index: 1;
        }

        .tool-price {
            font-size: 12px;
            color: #888;
            position: relative;
            z-index: 1;
        }

        .tool-price.free {
            color: #4caf50;
            font-weight: 600;
        }

        .tool-price.paid {
            color: #e91e63;
        }

        /* 情感连接进度 */
        .emotional-progress {
            margin: 15px;
            background: rgba(255,255,255,0.9);
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .level-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .level-icon {
            font-size: 20px;
        }

        .level-text {
            font-size: 16px;
            font-weight: 600;
            color: #5a5a5a;
        }

        .connection-value {
            font-size: 14px;
            color: #888;
        }

        .progress-bar {
            background: #f0f0f0;
            height: 12px;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
            position: relative;
        }

        .progress-fill {
            background: linear-gradient(90deg, #ffb3d1, #c8a8e9);
            height: 100%;
            border-radius: 10px;
            width: 70%;
            position: relative;
            transition: width 0.5s ease;
        }

        .progress-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            animation: progress-shine 2s ease-in-out infinite;
        }

        @keyframes progress-shine {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .next-level {
            font-size: 13px;
            color: #888;
            text-align: center;
        }

        .next-level .highlight {
            color: #e91e63;
            font-weight: 600;
        }


        /* 免费互动按钮组 */
        .free-interactions {
            display: flex;
            justify-content: space-around;
            margin-top: 15px;
            gap: 8px;
        }

        .interaction-btn {
            background: linear-gradient(135deg, #a8e6cf, #dcedc8);
            border: none;
            border-radius: 12px;
            padding: 10px 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            flex: 1;
            text-align: center;
            box-shadow: 0 4px 15px rgba(168, 230, 207, 0.3);
        }

        .interaction-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(168, 230, 207, 0.4);
        }

        .interaction-btn:active {
            transform: scale(0.95);
        }

        .btn-icon {
            font-size: 18px;
            margin-bottom: 4px;
        }

        .btn-text {
            font-size: 11px;
            font-weight: 500;
            color: #2e7d32;
        }

        /* 每日免费活动区域 */
        .daily-activities {
            margin: 15px;
            background: rgba(255,255,255,0.9);
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
        }

        .activity-item {
            display: flex;
            align-items: center;
            padding: 12px;
            background: linear-gradient(135deg, #fff, #f8f9ff);
            border-radius: 12px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .activity-item:hover {
            border-color: #a8e6cf;
            transform: translateX(5px);
        }

        .activity-icon {
            font-size: 24px;
            margin-right: 12px;
            width: 40px;
            text-align: center;
        }

        .activity-content {
            flex: 1;
        }

        .activity-title {
            font-size: 14px;
            font-weight: 600;
            color: #5a5a5a;
            margin-bottom: 2px;
        }

        .activity-desc {
            font-size: 12px;
            color: #888;
        }

        .activity-status {
            font-size: 11px;
            color: #4caf50;
            font-weight: 600;
        }

        /* 治愈特效 */
        .healing-effect {
            position: fixed;
            pointer-events: none;
            z-index: 1000;
            animation: healing-float 2s ease-out forwards;
        }

        @keyframes healing-float {
            0% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
            100% {
                opacity: 0;
                transform: translateY(-100px) scale(0.5);
            }
        }

        /* 双击提示 */
        .double-tap-hint {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.7);
            color: #fff;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 12px;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        .double-tap-hint.show {
            opacity: 1;
        }

        /* 响应式设计 */
        @media (max-width: 375px) {
            .game-container {
                max-width: 100%;
            }
            
            .character-avatar {
                width: 100px;
                height: 100px;
                font-size: 50px;
            }
            
            .tools-grid {
                gap: 8px;
            }
            
            .tool-item {
                padding: 12px 8px;
            }
        }

        /* 动画效果 */
        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .bounce-in {
            animation: bounceIn 0.6s ease-out;
        }

        @keyframes bounceIn {
            0% { transform: scale(0.3); opacity: 0; }
            50% { transform: scale(1.05); }
            70% { transform: scale(0.9); }
            100% { transform: scale(1); opacity: 1; }
        }
    </style>
</head>
<body>
    <div class="game-container">
        <!-- 头部区域 -->
        <div class="header">
            <div class="user-info">
                <div class="avatar">🌸</div>
                <div class="user-details">
                    <h3>小雨</h3>
                    <div class="bean-count">
                        💎 120
                    </div>
                </div>
            </div>
        </div>

        <!-- 主界面：虚拟偶像展示区 -->
        <div class="main-character-section fade-in">
            <!-- 角色大图展示 -->
            <div class="character-showcase">
                <div class="character-avatar-large" id="characterAvatar">🌸</div>
                <div class="character-name-large">温柔花艺师</div>
                <div class="character-desc-large" id="characterDesc">热爱生活，善于倾听<br>今天也要开心哦~</div>
            </div>

            <!-- 快速互动提示 -->
            <div class="quick-interaction-hint">
                💡 点击我聊天 • 双击屏幕治愈 • 长按撒娇
            </div>

            <!-- 情感连接进度条（简化版） -->
            <div class="simple-progress">
                <div class="progress-info">
                    <span class="level-text">🌸 熟悉朋友</span>
                    <span class="progress-value">350/500</span>
                </div>
                <div class="progress-bar-simple">
                    <div class="progress-fill-simple"></div>
                </div>
            </div>
        </div>

        <!-- 功能入口图标区域 -->
        <div class="function-entries fade-in">
            <!-- 聊天入口 -->
            <div class="entry-btn chat-entry" onclick="openChatInterface()">
                <div class="entry-icon">💬</div>
                <div class="entry-label">聊天</div>
                <div class="entry-badge" id="chatBadge">3</div>
            </div>

            <!-- 活动入口 -->
            <div class="entry-btn activity-entry" onclick="openActivityInterface()">
                <div class="entry-icon">🌟</div>
                <div class="entry-label">每日活动</div>
                <div class="entry-badge" id="activityBadge">4</div>
            </div>

            <!-- 道具入口 -->
            <div class="entry-btn tool-entry" onclick="openToolInterface()">
                <div class="entry-icon">🎁</div>
                <div class="entry-label">治愈道具</div>
            </div>

            <!-- 个人入口 -->
            <div class="entry-btn profile-entry" onclick="openProfileInterface()">
                <div class="entry-icon">👤</div>
                <div class="entry-label">我的</div>
            </div>
        </div>

        <!-- 二级界面：聊天界面（默认隐藏） -->
        <div class="secondary-interface" id="chatInterface" style="display: none;">
            <div class="interface-header">
                <div class="back-btn" onclick="closeSecondaryInterface()">← 返回</div>
                <div class="interface-title">💬 聊天</div>
            </div>
            <div class="interface-content">
                <!-- 免费互动按钮组 -->
                <div class="free-interactions">
                    <div class="interaction-btn" onclick="freeInteraction('greeting')">
                        <div class="btn-icon">👋</div>
                        <div class="btn-text">问候</div>
                    </div>
                    <div class="interaction-btn" onclick="freeInteraction('chat')">
                        <div class="btn-icon">💬</div>
                        <div class="btn-text">聊天</div>
                    </div>
                    <div class="interaction-btn" onclick="freeInteraction('comfort')">
                        <div class="btn-icon">🤗</div>
                        <div class="btn-text">安慰</div>
                    </div>
                    <div class="interaction-btn" onclick="freeInteraction('story')">
                        <div class="btn-icon">📖</div>
                        <div class="btn-text">故事</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 二级界面：每日活动界面（默认隐藏） -->
        <div class="secondary-interface" id="activityInterface" style="display: none;">
            <div class="interface-header">
                <div class="back-btn" onclick="closeSecondaryInterface()">← 返回</div>
                <div class="interface-title">🌟 每日活动</div>
            </div>
            <div class="interface-content">
                <div class="activity-item" onclick="doActivity('morning_greeting')">
                    <div class="activity-icon">🌅</div>
                    <div class="activity-content">
                        <div class="activity-title">早安问候</div>
                        <div class="activity-desc">获得温柔的早安祝福和今日能量</div>
                    </div>
                    <div class="activity-status">免费</div>
                </div>
                
                <div class="activity-item" onclick="doActivity('daily_chat')">
                    <div class="activity-icon">💬</div>
                    <div class="activity-content">
                        <div class="activity-title">日常聊天</div>
                        <div class="activity-desc">分享你的心情，获得贴心回应</div>
                    </div>
                    <div class="activity-status">免费</div>
                </div>
                
                <div class="activity-item" onclick="doActivity('comfort_time')">
                    <div class="activity-icon">🤗</div>
                    <div class="activity-content">
                        <div class="activity-title">安慰时光</div>
                        <div class="activity-desc">当你需要时，获得温暖安慰</div>
                    </div>
                    <div class="activity-status">免费</div>
                </div>
                
                <div class="activity-item" onclick="doActivity('bedtime_story')">
                    <div class="activity-icon">🌙</div>
                    <div class="activity-content">
                        <div class="activity-title">睡前故事</div>
                        <div class="activity-desc">听一个温柔的睡前故事</div>
                    </div>
                    <div class="activity-status">免费</div>
                </div>
            </div>
        </div>

        <!-- 二级界面：道具界面（默认隐藏） -->
        <div class="secondary-interface" id="toolInterface" style="display: none;">
            <div class="interface-header">
                <div class="back-btn" onclick="closeSecondaryInterface()">← 返回</div>
                <div class="interface-title">🎁 治愈道具</div>
            </div>
            <div class="interface-content">
                <div class="tools-grid">
                    <div class="tool-item paid" onclick="useTool('caring-heart')">
                        <div class="tool-icon">🌹</div>
                        <div class="tool-name">贴心关怀</div>
                        <div class="tool-price paid">1豆</div>
                    </div>
                    <div class="tool-item paid" onclick="useTool('soul-music')">
                        <div class="tool-icon">🎵</div>
                        <div class="tool-name">心灵音乐</div>
                        <div class="tool-price paid">3豆</div>
                    </div>
                    <div class="tool-item paid" onclick="useTool('rainbow-blessing')">
                        <div class="tool-icon">🌈</div>
                        <div class="tool-name">彩虹祝福</div>
                        <div class="tool-price paid">5豆</div>
                    </div>
                    <div class="tool-item paid" onclick="useTool('star-companion')">
                        <div class="tool-icon">✨</div>
                        <div class="tool-name">星辰陪伴</div>
                        <div class="tool-price paid">10豆</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 二级界面：个人界面（默认隐藏） -->
        <div class="secondary-interface" id="profileInterface" style="display: none;">
            <div class="interface-header">
                <div class="back-btn" onclick="closeSecondaryInterface()">← 返回</div>
                <div class="interface-title">👤 我的</div>
            </div>
            <div class="interface-content">
                <div class="profile-section">
                    <div class="profile-avatar">🌸</div>
                    <div class="profile-name">小雨</div>
                    <div class="profile-beans">💎 120 豆豆</div>
                </div>
                <div class="emotional-progress-detail">
                    <div class="progress-header">
                        <div class="level-info">
                            <div class="level-icon">🌸</div>
                            <div class="level-text">熟悉朋友</div>
                        </div>
                        <div class="connection-value">350/500</div>
                    </div>
                    <div class="progress-bar">
                        <div class="progress-fill"></div>
                    </div>
                    <div class="next-level">
                        再获得 <span class="highlight">150</span> 情感值，升级为知心朋友
                    </div>
                </div>
            </div>
        </div>

        <!-- 双击提示 -->
        <div class="double-tap-hint" id="doubleTapHint">
            双击屏幕获得治愈 ✨
        </div>

    </div>

    <script>
        // 双击治愈机制
        let tapCount = 0;
        let tapTimer = null;

        document.addEventListener('click', function(e) {
            tapCount++;
            
            if (tapCount === 1) {
                tapTimer = setTimeout(() => {
                    tapCount = 0;
                }, 300);
            } else if (tapCount === 2) {
                clearTimeout(tapTimer);
                tapCount = 0;
                triggerHealingEffect(e.clientX, e.clientY);
                showDoubleTapHint();
            }
        });

        // 治愈特效
        function triggerHealingEffect(x, y) {
            const effects = ['✨', '💖', '🌸', '⭐', '💫'];
            const effect = effects[Math.floor(Math.random() * effects.length)];
            
            const healingElement = document.createElement('div');
            healingElement.className = 'healing-effect';
            healingElement.innerHTML = effect;
            healingElement.style.left = x + 'px';
            healingElement.style.top = y + 'px';
            healingElement.style.fontSize = '24px';
            
            document.body.appendChild(healingElement);
            
            // 角色反应
            const characterAvatar = document.getElementById('characterAvatar');
            characterAvatar.style.transform = 'scale(1.1)';
            setTimeout(() => {
                characterAvatar.style.transform = 'scale(1)';
            }, 300);
            
            setTimeout(() => {
                document.body.removeChild(healingElement);
            }, 2000);
        }

        // 显示双击提示
        function showDoubleTapHint() {
            const hint = document.getElementById('doubleTapHint');
            hint.classList.add('show');
            setTimeout(() => {
                hint.classList.remove('show');
            }, 1500);
        }

        // 免费互动功能
        function freeInteraction(type) {
            const interactions = {
                'greeting': { 
                    emoji: '👋', 
                    messages: [
                        '你好！今天天气真不错呢~',
                        '欢迎回来！想和我聊聊天吗？',
                        '嗨！你今天看起来很棒哦！'
                    ]
                },
                'chat': { 
                    emoji: '💬', 
                    messages: [
                        '想聊什么呢？我在这里认真听哦~',
                        '今天有什么开心的事情要分享吗？',
                        '不管说什么，我都会认真听的'
                    ]
                },
                'comfort': { 
                    emoji: '🤗', 
                    messages: [
                        '累了就休息一下吧，我陪着你',
                        '每个人都会有困难的时候，这很正常',
                        '你已经很努力了，给自己一个拥抱吧'
                    ]
                },
                'story': { 
                    emoji: '📖', 
                    messages: [
                        '想听什么故事呢？我有好多温暖的故事',
                        '从前有一个... 啊，你想听什么类型的？',
                        '我来讲个关于友谊的小故事吧~'
                    ]
                }
            };
            
            const interaction = interactions[type];
            if (interaction) {
                const randomMessage = interaction.messages[Math.floor(Math.random() * interaction.messages.length)];
                showToolEffect(interaction.emoji, randomMessage);
                updateEmotionalConnection(5);
            }
        }

        // 每日免费活动
        function doActivity(activityType) {
            const activities = {
                'morning_greeting': { 
                    emoji: '🌅', 
                    message: '早安！新的一天开始了，愿你今天充满阳光和美好~',
                    value: 15
                },
                'daily_chat': { 
                    emoji: '💬', 
                    message: '今天过得怎么样？有什么想和我分享的吗？',
                    value: 10
                },
                'comfort_time': { 
                    emoji: '🤗', 
                    message: '如果累了，就来我这里休息一下吧。我会一直陪着你~',
                    value: 20
                },
                'bedtime_story': { 
                    emoji: '🌙', 
                    message: '睡前故事时间到！今天讲一个关于勇气和友谊的故事...',
                    value: 25
                }
            };
            
            const activity = activities[activityType];
            if (activity) {
                showToolEffect(activity.emoji, activity.message);
                updateEmotionalConnection(activity.value);
                
                // 显示完成状态
                setTimeout(() => {
                    alert('✨ 活动完成！获得了' + activity.value + '情感值');
                }, 800);
            }
        }

        // 使用治愈道具
        function useTool(toolType) {
            const toolEffects = {
                'caring-heart': { emoji: '🌹', message: '你值得被温柔对待，你很重要' },
                'soul-music': { emoji: '🎵', message: '让我们一起听一首治愈的音乐，放松心情' },
                'rainbow-blessing': { emoji: '🌈', message: '彩虹祝福送给你，愿你每天都充满色彩' },
                'star-companion': { emoji: '✨', message: '星辰陪伴着你，即使在最黑暗的夜晚也有光明' }
            };
            
            const effect = toolEffects[toolType];
            if (effect) {
                // 显示道具效果
                showToolEffect(effect.emoji, effect.message);
                
                // 更新情感连接值（付费道具给更多）
                updateEmotionalConnection(20);
            }
        }

        // 显示道具效果
        function showToolEffect(emoji, message) {
            const characterAvatar = document.getElementById('characterAvatar');
            
            // 角色动画
            characterAvatar.style.animation = 'bounceIn 0.6s ease-out';
            
            // 创建效果元素
            const effectElement = document.createElement('div');
            effectElement.innerHTML = emoji;
            effectElement.style.position = 'fixed';
            effectElement.style.fontSize = '48px';
            effectElement.style.left = '50%';
            effectElement.style.top = '50%';
            effectElement.style.transform = 'translate(-50%, -50%)';
            effectElement.style.zIndex = '1000';
            effectElement.style.pointerEvents = 'none';
            effectElement.style.animation = 'bounceIn 0.6s ease-out';
            
            document.body.appendChild(effectElement);
            
            // 显示消息
            setTimeout(() => {
                alert(message);
                document.body.removeChild(effectElement);
                characterAvatar.style.animation = '';
            }, 600);
        }

        // 更新情感连接值
        function updateEmotionalConnection(value) {
            const currentValue = 350;
            const newValue = Math.min(currentValue + value, 500);
            
            // 更新进度条
            const progressFill = document.querySelector('.progress-fill');
            const percentage = (newValue / 500) * 100;
            progressFill.style.width = percentage + '%';
            
            // 更新数值显示
            const connectionValue = document.querySelector('.connection-value');
            connectionValue.textContent = newValue + '/500';
            
            // 检查是否升级
            if (newValue >= 500) {
                setTimeout(() => {
                    alert('🎉 恭喜！你已升级为知心朋友！');
                }, 1000);
            }
        }

        // 二级界面控制函数
        function openChatInterface() {
            document.getElementById('chatInterface').style.display = 'block';
            setTimeout(() => {
                document.getElementById('chatInterface').classList.add('show');
            }, 10);
        }

        function openActivityInterface() {
            document.getElementById('activityInterface').style.display = 'block';
            setTimeout(() => {
                document.getElementById('activityInterface').classList.add('show');
            }, 10);
        }

        function openToolInterface() {
            document.getElementById('toolInterface').style.display = 'block';
            setTimeout(() => {
                document.getElementById('toolInterface').classList.add('show');
            }, 10);
        }

        function openProfileInterface() {
            document.getElementById('profileInterface').style.display = 'block';
            setTimeout(() => {
                document.getElementById('profileInterface').classList.add('show');
            }, 10);
        }

        function closeSecondaryInterface() {
            const interfaces = document.querySelectorAll('.secondary-interface');
            interfaces.forEach(interface => {
                interface.classList.remove('show');
                setTimeout(() => {
                    interface.style.display = 'none';
                }, 300);
            });
        }

        // 角色点击交互
        document.getElementById('characterAvatar').addEventListener('click', function() {
            const messages = [
                '你来了，今天过得怎么样？',
                '看起来有点累呢，要不要听听音乐？',
                '我懂你的感受，每个人都需要这样的时候',
                '你值得被温柔对待',
                '让我们一起享受这个美好的时刻',
                '点击下面的按钮，我们可以聊更多哦~',
                '今天想做什么呢？我都可以陪你'
            ];
            
            const randomMessage = messages[Math.floor(Math.random() * messages.length)];
            
            // 角色反应动画
            this.style.transform = 'scale(1.05) rotate(5deg)';
            setTimeout(() => {
                this.style.transform = 'scale(1) rotate(0deg)';
            }, 300);
            
            // 显示消息
            setTimeout(() => {
                alert(randomMessage);
                updateEmotionalConnection(2);
            }, 300);
        });

        // 长按角色撒娇
        let longPressTimer = null;
        document.getElementById('characterAvatar').addEventListener('mousedown', function() {
            longPressTimer = setTimeout(() => {
                const characterDesc = document.getElementById('characterDesc');
                const originalDesc = characterDesc.innerHTML;
                characterDesc.innerHTML = '嘻嘻~ 你摸我这么久，是不是很喜欢我呀？😊';
                characterDesc.style.color = '#e91e63';
                
                setTimeout(() => {
                    characterDesc.innerHTML = originalDesc;
                    characterDesc.style.color = '';
                }, 3000);
                
                updateEmotionalConnection(8);
                triggerHealingEffect(200, 200);
            }, 1000);
        });

        document.getElementById('characterAvatar').addEventListener('mouseup', function() {
            clearTimeout(longPressTimer);
        });

        document.getElementById('characterAvatar').addEventListener('mouseleave', function() {
            clearTimeout(longPressTimer);
        });

        // 页面加载动画
        window.addEventListener('load', function() {
            const elements = document.querySelectorAll('.fade-in');
            elements.forEach((element, index) => {
                setTimeout(() => {
                    element.style.opacity = '1';
                    element.style.transform = 'translateY(0)';
                }, index * 200);
            });
        });

        // 初始化样式
        document.querySelectorAll('.fade-in').forEach(element => {
            element.style.opacity = '0';
            element.style.transform = 'translateY(20px)';
            element.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
        });
    </script>
</body>
</html>
